import { reqCategoryList } from "@/api"
import { reqBannerList } from "@/api"
import { reqFloorList } from "@/api"
const actions={
    async categoryList(context){
        let result=await reqCategoryList()
        if(result.code===200){
         context.commit('CATEGORYLIST',result.data.splice(0,15))
        }
    },
    async getBannerList(context){
        let results=await reqBannerList()
        if(results.code===200){
         context.commit('GETBANNERLIST',results.data)
        }
    }, 
    async getFloorList(context){
        let resulted=await reqFloorList()
        if(resulted.code===200){
         context.commit('GETFLOORLIST',resulted.data)
        }
    }, 

}
const mutations={
    CATEGORYLIST(state,a){
     state.b=a
    },
    GETBANNERLIST(state,c){
        state.d=c
       },
    GETFLOORLIST(state,e){
        state.f=e
       },
}
const state={b:[],d:[],f:[]}
const getters={}
export default{
    actions,
    mutations,
    state,
    getters
}